#include "../maze.h"
#include "../room.h"
#include "../wall.h"
#include "../door.h"
#include "mazegame.h"
#include <QDebug>

Maze *MazeGame::createMaze()
{
    Maze *aMaze = makeMaze();

    Room *r1 = makeRoom(1);
    Room *r2 = makeRoom(2);
    Door *theDoor = makeDoor(r1, r2);

    aMaze->addRoom(r1);
    aMaze->addRoom(r2);

    r1->setSide(D_North, makeWall());
    r1->setSide(D_East, theDoor);
    r1->setSide(D_South, makeWall());
    r1->setSide(D_West, makeWall());

    r2->setSide(D_North, makeWall());
    r2->setSide(D_East, makeWall());
    r2->setSide(D_South, makeWall());
    r2->setSide(D_West, theDoor);

    return aMaze;
}

Maze *MazeGame::makeMaze() const
{
    qDebug() << "MazeGame::makeMaze()";
    return new Maze;
}

Room *MazeGame::makeRoom(int n) const
{
    qDebug() << "MazeGame::makeRoom(int n)";
    return new Room(n);
}

Wall *MazeGame::makeWall() const
{
    qDebug() << "MazeGame::makeWall()";
    return new Wall;
}

Door *MazeGame::makeDoor(Room *r1, Room *r2) const
{
    qDebug() << "MazeGame::makeDoor(Room *r1, Room *r2)";
    return new Door(r1, r2);
}
